package com.ruyuan.seckilling.inventory.api;

import com.ruyuan.seckilling.inventory.vo.CleanStockRequest;
import com.ruyuan.seckilling.inventory.vo.ProductStockVo;
import com.ruyuan.seckilling.inventory.vo.QueryCurrentStockRequest;
import com.ruyuan.seckilling.inventory.vo.SyncProductStockRequest;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * @author zhonghuashishan
 */
@FeignClient("ruyuan-seckilling-inventory-service")
@RequestMapping("/inventory")
public interface InventoryApi {

    @PostMapping("/syncStock")
    Boolean syncStock(@RequestBody List<SyncProductStockRequest> request);

    @PostMapping("/queryCurrentStock")
    List<ProductStockVo> queryCurrentStock(@RequestBody QueryCurrentStockRequest request);

    @PostMapping("/cleanStock")
    List<ProductStockVo> cleanStock(@RequestBody CleanStockRequest request);
}